package fx.game.demo.window;


import fx.game.demo.common.BaseMeta;
import fx.game.demo.common.GameResource;
import fx.game.demo.entity.RectangleAndNumber;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.FlowPane;
import javafx.stage.Stage;

/**
 *
 * @author: datom
 *
 * @create: 2021/12/6 13:45
 *
 * @Deprecated 颜色表，显示所有方块的颜色
 *
 **/
public class ColorTableWindow extends Stage {

    public ColorTableWindow() {
        setWidth(BaseMeta.COLOR_TABLE_WINDOW_WIDTH);
        setHeight(BaseMeta.COLOR_TABLE_WINDOW_HEIGHT);

        setTitle("方块颜色表");
        setResizable(false);
        setFullScreen(false);
        setIconified(false);

        getIcons().add(GameResource.getAppIcon());

        BorderPane borderPane = new BorderPane();
        borderPane.setPrefHeight(430);
        borderPane.setPrefWidth(430);

        FlowPane flowPane = new FlowPane();

        flowPane.setMinSize(BaseMeta.RECTANGLE_WIDTH * 4, BaseMeta.RECTANGLE_HEIGHT * 4);
        flowPane.setPrefSize(BaseMeta.RECTANGLE_WIDTH * 4, BaseMeta.RECTANGLE_HEIGHT * 4);
        flowPane.setMaxSize(BaseMeta.RECTANGLE_WIDTH * 4, BaseMeta.RECTANGLE_HEIGHT * 4);

        for (int i = 0; i < RectangleAndNumber.COLORS_LENGTH; i++) {
            flowPane.getChildren().add(new RectangleAndNumber(i, 1 << i));
        }
        borderPane.setCenter(flowPane);
        Scene scene = new Scene(borderPane);
        this.setScene(scene);
    }
}
